
package org.finegold.core.discern.config;

import lombok.AllArgsConstructor;
import org.finegold.core.discern.props.DiscernProperties;
import org.finegold.core.discern.service.impl.DiscernApiImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 文字识别配置类
 *
 * @author QinXueFeng
 */
@Configuration
@AllArgsConstructor
@EnableConfigurationProperties(DiscernProperties.class)
public class DiscernConfiguration {

	private final DiscernProperties discernProperties;
	@Bean
	@ConditionalOnMissingBean(DiscernApiImpl.class)
	public DiscernApiImpl discernApi() {
		return new DiscernApiImpl(discernProperties);
	}
}
